import request from "@/utils/request";

export const getGoodsList = (params) => {
  return request({
    method: "GET",
    url: "/private/v1/goods",
    params,
  });
};

export const delGoodsApi = (id) => {
  return request({
    method: "DELETE",
    url: "/private/v1/goods/" + id,
  });
};

export const getCategoriesListApi = () => {
  return request({
    method: "GET",
    url: "/private/v1/categories",
  });
};
export const getAttributesApi = (id, params) => {
  return request({
    method: "GET",
    url: `/private/v1/categories/${id}/attributes`,
    params,
  });
};

export const getAttributesOnlyApi = (id, params) => {
  return request({
    method: "GET",
    url: `/private/v1/categories/${id}/attributes`,
    params,
  });
};

export const addGoodInfoApi = (data) => {
  return request({
    method: "POST",
    url: "/private/v1/goods",
    data,
  });
};
